package cn.mw.cmdb.entity;

import cn.mw.cmdb.util.DataCreateInfo;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;

@Data
@Document("mw_cmdbmd_datasource_sync_result")
public class DataSourceSyncResultInfo implements DataCreateInfo, Serializable {

    @CMDBProperty(searchType = PropertyTypeString.ID, searchPrefix = "_")
    @AutoId
    @Schema(description = "id")
    private String id;

    @Schema(description = "数据源Id")
    @CMDBProperty
    private String dataSourceId;

    @Schema(description = "成功数量")
    @CMDBProperty
    private int successCount;

    @Schema(description = "失败数量")
    @CMDBProperty
    private int failedCount;

    @Schema(description = "同步时间")
    @CMDBProperty
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date syncTime;
}
